package com.persondemo.videoappliction.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.persondemo.videoappliction.R;
import com.persondemo.videoappliction.bean.MainBean;
import com.persondemo.videoappliction.bean.TvMovieBean;
import com.persondemo.videoappliction.utils.ImageLoaderUtil;

import java.util.List;

/**
 * Created by Administrator on 2018/3/28.
 */

public class BaseVideoAdapter  extends BaseQuickAdapter<TvMovieBean.DataBean.DylistBean, BaseViewHolder> {
    private Context mContext;

    public BaseVideoAdapter(@Nullable List<TvMovieBean.DataBean.DylistBean> data, Context mContext) {
        super(R.layout.module_include_recycle, data);
        this.mContext = mContext;
    }

    @Override
    protected void convert(BaseViewHolder helper,TvMovieBean.DataBean.DylistBean item) {
        ImageLoaderUtil.LoadImage(mContext, item.getImgs(), (ImageView) helper.getView(R.id.recler_base_img));
        if (item.getType().equals("电影")){
            helper.setText(R.id.recler_base_text,item.getPing());
        }else {
            helper.setText(R.id.recler_base_text,item.getJishu());
        }
        helper.setText(R.id.recler_base_name,item.getName());

    }
}
